#ifndef WORKER_H_
#define WORKER_H_
#include "conf.h"

C_CODE_BEGIN
/*
 * This design is wired for C , since it indeed use OOD .
 * The reason to use this design is for I want to make the
 * manager be adaptable for different kinds of worker type.
 * The reality is cruel , no one fits all solution.
 */

struct th_join_sec;
struct task;

struct worker {
	bool (*join)( struct worker* , const struct th_join_sec* ti );
	void* (*dispatch)( struct worker* , const struct task* task );
	void (*signal_quit)( struct worker* , bool right_now );
	bool (*ctl)( struct worker* , const char* , ... );
	size_t (*get_workload)( struct worker* );
};

C_CODE_END

#endif // WORKER_H_S